import request from '@/utils/request'
const baseUrl = '/strategy-suggestion-back/strategy-suggestion-back/v1.0/'
const apiHome = {
  // 处置建议（告警汇总）
  getAlarmSummary: function (data) {
    return request({
      url: baseUrl + 'record/summary/list',
      method: 'post',
      data
    })
  },
  // 屏蔽
  getShield: function (params) {
    return request({
      url: baseUrl + 'record/update/state',
      method: 'get',
      params
    })
  },
  // 处置建议（告警删除）
  getDelete: function (params) {
    return request({
      url: baseUrl + 'record/delete',
      method: 'get',
      params
    })
  },
  // 告警图表
  getAlarmChart: function (params) {
    return request({
      url: baseUrl + 'record/charts',
      method: 'post',
      data: params
    })
  },
  // 门限告警记录列表
  getThresholdList: function (params) {
    return request({
      url: baseUrl + 'record/threshold/list',
      method: 'post',
      data: params
    })
  },
  // 常值检测告警记录列表
  getConstantList: function (params) {
    return request({
      url: baseUrl + 'record/constant/list',
      method: 'post',
      data: params
    })
  },
  // 关联分析告警记录
  getAnalyseList: function (params) {
    return request({
      url: baseUrl + 'record/analyse/list',
      method: 'post',
      data: params
    })
  },
  // 时序计算告警记录
  getSequenceList: function (params) {
    return request({
      url: baseUrl + 'record/timeSeries/list',
      method: 'post',
      data: params
    })
  },
  // 复杂模型告警记录
  getComplexList: function (params) {
    return request({
      url: baseUrl + 'record/modelInference/list',
      method: 'post',
      data: params
    })
  },
  // 处置建议 告警弹框
  getAlarmDetail: function () {
    return request({
      url: baseUrl + 'record/alter',
      method: 'get'
    })
  },
  // 获取处置策略建议
  getStrategy: function (id) {
    return request({
      url: baseUrl + 'suggest/list?id=' + id,
      method: 'get'
    })
  },
  // 建议选择
  getStrategySelect: function (data) {
    return request({
      url: baseUrl + 'suggest/back',
      method: 'put',
      data
    })
  },
  getUpgradeInfo: function (
    data = {
      deviceId: '',
      satId: '',
      type: ''
    }
  ) {
    return request({
      url: baseUrl + 'upgrade/info',
      method: 'get',
      params: data
    })
  },
  upgradeSave: function (data) {
    if (data.id) {
      return request({
        url: baseUrl + 'upgrade/update',
        method: 'post',
        data
      })
    } else {
      return request({
        url: baseUrl + 'upgrade/add',
        method: 'post',
        data
      })
    }
  }
}
export { apiHome }
